
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"  
                xmlns:h="http://java.sun.com/jsf/html"  
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:p="http://primefaces.prime.com.tr/ui"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                template="/templates/FoodSageTemplateUnauthenticated.xhtml">

    <ui:define name="content">  

        <!-- panel for dividing web page into sections -->
        <p:panel id="panel" header="#{bundle['activity.header.panel']}">  
            <p:messages/>
            <h:panelGrid columns="3"  cellpadding="5" >
                <h:outputLabel id="activityTypeLabel" value="#{bundle['activity.type.label']}" style="font-weight: bold"/>
                <h:selectOneMenu id="type" value="#{activityCreateAttractionManagedBean.activityType}" required="true" requiredMessage="#{bundle['activity.type.required']}">
                    <f:selectItems value="#{enumActivityType.listItems}"/>
                </h:selectOneMenu>
                <p:message for="type"/>

                <h:outputLabel id="activityNameLabel" value ="#{bundle['activity.name.label']}" style="font-weight: bold"/>
                <p:inputText id="activityName" value="#{activityCreateAttractionManagedBean.activityName}" required="true" requiredMessage="#{bundle['activity.name.required']}"/>
                <p:message for="activityName"/>

                <h:outputLabel id="activityDescLabel" value ="#{bundle['activity.desc.label']}" style="font-weight: bold"/>
                <p:inputText id="activityDesc" value="#{activityCreateAttractionManagedBean.activityDesc}" required="true" requiredMessage="#{bundle['activity.desc.required']}"/>
                <p:message for="activityDesc"/>

                <h:outputLabel id="activitySingaporeAreaLabel" value ="#{bundle['activity.singaporeArea.label']}" style="font-weight: bold"/>
                <h:selectOneMenu id="singaporeAreaMenu" value="#{activityCreateAttractionManagedBean.singaporeArea}">
                    <f:selectItems id="singaporeArea" value="#{enumSingaporeArea.listItems}"/>
                </h:selectOneMenu>
                <p:message for="singaporeArea"/>

                <h:outputLabel id="activityOpeningHourLabel" value ="#{bundle['activity.openingHour.label']}" style="font-weight: bold"/>
                <h:selectOneMenu id="openingHourMenu" value="#{activityCreateAttractionManagedBean.openingHour}">
                    <f:selectItems id="openingHour" value="#{enumTime24H.listItems}"/>
                </h:selectOneMenu>
                <p:message for="openingHour"/>

                <h:outputLabel id="activityClosingHourLabel" value ="#{bundle['activity.closingHour.label']}" style="font-weight: bold"/>
                <h:selectOneMenu id="closingHourMenu" value="#{activityCreateAttractionManagedBean.closingHour}" >
                    <f:selectItems id="closingHour" value="#{enumTime24H.listItems}"/>
                </h:selectOneMenu>
                <p:message for="closingHour"/>

                <h:outputLabel id="blockNumberLabel" value="#{bundle['activity.blockNumber.label']}" style="font-weight: bold"/>  
                <h:inputText id="blockNumber" value="#{activityCreateAttractionManagedBean.blkNumber}" required="true" requiredMessage="#{bundle['activity.blockNumber.required']}"/>
                <p:message for="blockNumber"/>

                <h:outputLabel id="buildingNameLabel" value="#{bundle['activity.buildingName.label']}" style="font-weight: bold"/>  
                <h:inputText id="buildingName" value="#{activityCreateAttractionManagedBean.buildingName}" required="false" requiredMessage="#{bundle['activity.buildingName.required']}"/>
                <p:message for="buildingName"/>

                <h:outputLabel id="streetNameLabel" value="#{bundle['activity.streetName.label']}" style="font-weight: bold"/>  
                <h:inputText id="streetName" value="#{activityCreateAttractionManagedBean.streetName}" required="true" requiredMessage="#{bundle['activity.streetName.required']}"/>
                <p:message for="streetName"/>

                <h:outputLabel id="unitNumberLabel" value="#{bundle['activity.unitNumber.label']}" style="font-weight: bold"/>  
                <h:inputText id="unitNumber" value="#{activityCreateAttractionManagedBean.unitNumber}" required="true" requiredMessage="#{bundle['activity.unitNumber.required']}"/>
                <p:message for="unitNumber"/>

                <h:outputLabel id="postalCodeLabel" value="#{bundle['activity.postalCode.label']}" style="font-weight: bold"/>  
                <h:inputText id="postalCode" value="#{activityCreateAttractionManagedBean.postalCode}" required="true" requiredMessage="#{bundle['activity.postalCode.required']}" maxlength="6"/>
                <p:message for="postalCode"/>

            </h:panelGrid>
            <p:commandButton id="create" value="#{bundle['activity.create.button']}" update="panel" actionListener="#{activityCreateAttractionManagedBean.createAttraction}" />
        </p:panel> 
    </ui:define>  
</ui:composition>
